{include file="Include/H_ui_head" /}

<article class="page-container">
<div class="page-container">
	<form action="javascript:;" method="post" class="form form-horizontal" id="form-admin-add" enctype="multipart/form-data">
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>订单号：</label>
		<div class="formControls col-xs-8 col-sm-9">
			{$data.order_sn}
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>订单状态：</label>
		<div class="formControls col-xs-8 col-sm-9">
				 {if $data.status == 0}
				 定金
				 {elseif $data.status == 1}
				 违约
				 {elseif $data.status== 2}
				 完成
				 {/if}
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>定金凭证：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<img src ="/Uploads/order/{$data.pay_voucher_deposit} " />
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>收货人姓名：</label>
		<div class="formControls col-xs-8 col-sm-9">
			{$data.address_name}
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>收货人联系电话：</label>
		<div class="formControls col-xs-8 col-sm-9">
			{$data.adderss_mobile}
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>收货人地址：</label>
		<div class="formControls col-xs-8 col-sm-9">
			{$data.area}{$data.address_detail}
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>下单时间：</label>
		<div class="formControls col-xs-8 col-sm-9">
			{$data.create_time}
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>尾款凭证：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<img src ="/Uploads/order/{$data.pay_voucher_tail}" />
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>更改状态：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="radio" value="1" style="width: 15px;height: 15px;" name="category" rowid="_empty" role="textbox" class="FormElement form-control" >违约
			<input type="radio" value="2" style="width: 15px;height: 15px;" name="category" rowid="_empty" role="textbox" class="FormElement form-control" >完成
		</div>
	</div>
	<div class="row cl" id="sub">
		<div class="col-xs-8 col-sm-9 colo_-xs-offset-4 col-sm-offset-3">
			<input type="hidden" id="o_id" name="id" value="{$data.id}">
			<button class="btn btn-primary radius" onclick="edit()"> 提交</button>
		</div>
	</div>
	</form>
	</div>
</article>
{include file="Include/H_ui_foot" /}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
//默认值选中
window.onload=function(){
	var pid = '{$data["id"]}';
	var pids = pid.split(",");
	$("[name='tid']").attr("disabled",true);
	for(var i=0; i<pids.length; i++){
		$('[value="'+pids[i]+'"]').attr('checked',true);
	}
}
$("[name='time']").focus(function(){

});

$(function(){
	$(".permission-list dt input:checkbox").click(function(){
		$(this).closest("dl").find("dd input:checkbox").prop("checked",$(this).prop("checked"));
	});
	$(".permission-list2 dd input:checkbox").click(function(){
		var l =$(this).parent().parent().find("input:checked").length;
		var l2=$(this).parents(".permission-list").find(".permission-list2 dd").find("input:checked").length;
		if($(this).prop("checked")){
			$(this).closest("dl").find("dt input:checkbox").prop("checked",true);
			$(this).parents(".permission-list").find("dt").first().find("input:checkbox").prop("checked",true);
		}
		else{
			if(l==0){
				$(this).closest("dl").find("dt input:checkbox").prop("checked",false);
			}
			if(l2==0){
				$(this).parents(".permission-list").find("dt").first().find("input:checkbox").prop("checked",false);
			}
		}
	});
});

function edit()
{
    var id = $("#o_id").val();
    var category = $("[name='category']:checked").val();
	var loading =layer.msg('正在提交数据，请稍后...',{time:5000});
		$.post('{:url("Order/edit")}',{id:id,category:category},function(data){
		 layer.close(loading);
         if(data.code=='1'){
        	 layer.msg(data.msg,{time:2000});
             setTimeout(function(){
            	 layer_close(this.index);
             },1000);
         }else{
        	 layer.msg(data.msg,{time:2000});
         }
    });
}

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
